﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;

namespace DotNet.Random
{
    /// <summary>
    /// 系统方法扩展类
    /// </summary>
    public static class Extention
    {
        #region is in between and

        /// <summary>
        /// Determines whether [is in between and] [the specified target].
        /// 指定时间是否在这两个时间范围内
        /// </summary>
        /// <param name="target">The target.源时间</param>
        /// <param name="start">The start.开始时间</param>
        /// <param name="end">The end.结束时间</param>
        /// <returns>
        ///   <c>true</c> if [is in between and] [the specified target]; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsInBetweenAnd(this System.DateTime target, System.DateTime start, System.DateTime end)
        {
            var res = false;
            if (target > start && target < end)
            {
                res = true;
            }
            return res;
        }

        /// <summary>
        /// Determines whether [is in between and] [the specified target].
        /// 指定数字是否在这两个数字之间
        /// </summary>
        /// <param name="target">The target.源数字</param>
        /// <param name="start">The start.开始数字</param>
        /// <param name="end">The end.结束数字</param>
        /// <returns>
        ///   <c>true</c> if [is in between and] [the specified target]; otherwise, <c>false</c>.
        /// </returns>
        public static bool IsInBetweenAnd(this int target, int start, int end)
        {
            var res = false;
            if (target >= start && target <= end)
            {
                res = true;
            }
            return res;
        }

        #endregion
    }
}
